package com.lg.customRxJava;




public final class ObservableJust<T> extends Observable<T> implements ScalarSupplier<T> {


    private final T value;
    public ObservableJust(final T value) {
        this.value = value;
    }

    @Override
    protected void subscribeActual(Observer<? super T> observer) {
        ObservableScalarXMap.ScalarDisposable<T> sd = new ObservableScalarXMap.ScalarDisposable<>(observer, value);
        observer.onSubscribe(sd);
        sd.run();
    }

    @Override
    public T get() {
        return value;
    }

    @Override
    public void subscribe(Observer<? super T> observer) {

    }
}


